webpackJsonp([12],{

/***/ "Dppj":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/promise.js
var promise = __webpack_require__("rVsN");
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__("KH7x");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// EXTERNAL MODULE: ./src/common/utils/index.js
var utils = __webpack_require__("dh3M");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/emergency/components/detail.vue




//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ var detail = ({
  data: function data() {
    return {
      item: {}
    };
  },

  props: {
    id: {}
  },
  methods: {
    /**
     * yj_emergency_information 事故信息表
     */
    initData: function initData() {
      var _this = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var p, _ref, _ref2, item, entList, accidentTypeDic;

        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                p = [commonApi["a" /* commonApi */].searchById('yj_emergency_information', _this.id), commonApi["a" /* commonApi */].search('ent_enterprise'), commonApi["a" /* commonApi */].dictionary('Accident_type')];
                _context.next = 3;
                return promise_default.a.all(p);

              case 3:
                _ref = _context.sent;
                _ref2 = slicedToArray_default()(_ref, 3);
                item = _ref2[0];
                entList = _ref2[1];
                accidentTypeDic = _ref2[2];
                _context.next = 10;
                return Object(utils["d" /* ReplaceDictionary */])(item, {
                  accident_type: accidentTypeDic,
                  "enterprise_name:EnterpriseName:id": entList
                });

              case 10:
                _this.item = _context.sent;

              case 11:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this);
      }))();
    }
  },
  watch: {
    id: function id() {
      this.initData();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-6295f1e7","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/emergency/components/detail.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('yt-card',{attrs:{"title":"基本信息"}},[_c('yt-cell',{attrs:{"label":"事故企业","value":_vm.item.enterprise_name}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"事故类型","value":_vm.item.accident_type}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"事发地点","value":_vm.item.accident_place}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"事发时间","value":_vm._f("formatTime")(_vm.item.createdAt)}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"初步原因"},model:{value:(_vm.item.preliminary_cause),callback:function ($$v) {_vm.$set(_vm.item, "preliminary_cause", $$v)},expression:"item.preliminary_cause"}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"简要经过"},model:{value:(_vm.item.things_go_through),callback:function ($$v) {_vm.$set(_vm.item, "things_go_through", $$v)},expression:"item.things_go_through"}})],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"报告人信息"}},[_c('yt-cell',{attrs:{"label":"所在部门","value":_vm.item.text}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"报警人","value":_vm.item.name}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"职务","value":_vm.item.post}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"报警电话","border":"none"}},[_c('yt-cell-call',{attrs:{"tel":_vm.item.telephone || ''}})],1)],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"伤亡情况"}},[_c('yt-cell',{attrs:{"label":"死亡人数","value":((_vm.item.Casualty || 0) + "人（预估）")}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"重伤人数","value":((_vm.item.serious_injury || 0) + "人（预估）")}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"经济损失","value":((_vm.item.economics || 0) + "万元（预估）")}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"撤离情况"},model:{value:(_vm.item.evacuate),callback:function ($$v) {_vm.$set(_vm.item, "evacuate", $$v)},expression:"item.evacuate"}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"环境影响"},model:{value:(_vm.item.contaminated),callback:function ($$v) {_vm.$set(_vm.item, "contaminated", $$v)},expression:"item.contaminated"}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"协调事项"},model:{value:(_vm.item.help),callback:function ($$v) {_vm.$set(_vm.item, "help", $$v)},expression:"item.help"}})],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"附件"}},[_c('yt-file',{attrs:{"uploadFile":function (){},"disabled":true},model:{value:(_vm.item.file),callback:function ($$v) {_vm.$set(_vm.item, "file", $$v)},expression:"item.file"}})],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var components_detail = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/emergency/components/detail.vue
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  detail,
  components_detail,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var emergency_components_detail = __webpack_exports__["a"] = (Component.exports);


/***/ }),

/***/ "HCRc":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "HGe3":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/promise.js
var promise = __webpack_require__("rVsN");
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__("KH7x");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js
var helpers_extends = __webpack_require__("4YfN");
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./src/common/anjian/emergency/components/detail.vue + 2 modules
var detail = __webpack_require__("Dppj");

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// EXTERNAL MODULE: ./src/common/utils/index.js
var utils = __webpack_require__("dh3M");

// EXTERNAL MODULE: ./src/common/plugin/index.js + 207 modules
var common_plugin = __webpack_require__("Tvds");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/emergency/preliminary.vue





//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//






var TABS = {
  info: '事故信息',
  cases: '相似案例',
  plans: '匹配预案'
};

/* harmony default export */ var preliminary = ({
  data: function data() {
    var _this = this;

    return {
      TABS: TABS,
      page: 0,
      id: null,
      emergencyObj: {},
      searchApi: function () {
        var _ref = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(_ref2, name) {
          var skip = _ref2.skip,
              limit = _ref2.limit;
          var param;
          return regenerator_default.a.wrap(function _callee$(_context) {
            while (1) {
              switch (_context.prev = _context.next) {
                case 0:
                  param = { skip: skip, limit: limit };
                  _context.t0 = name;
                  _context.next = _context.t0 === TABS.cases ? 4 : _context.t0 === TABS.plans ? 5 : 6;
                  break;

                case 4:
                  return _context.abrupt('return', _this.fetchCases(param));

                case 5:
                  return _context.abrupt('return', _this.fetchPlans(param));

                case 6:
                  return _context.abrupt('return', []);

                case 7:
                case 'end':
                  return _context.stop();
              }
            }
          }, _callee, _this);
        }));

        return function searchApi(_x, _x2) {
          return _ref.apply(this, arguments);
        };
      }()
    };
  },

  components: { detail: detail["a" /* default */] },
  activated: function activated() {
    var id = this.$route.query.id;

    this.id = id;
  },

  methods: {
    fetchCases: function fetchCases(param) {
      var _this2 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
        var items;
        return regenerator_default.a.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.next = 2;
                return commonApi["a" /* commonApi */].search('yj_emergency_information', extends_default()({
                  equalTo: { accident_type: _this2.$route.query.accident_type },
                  notEqualTo: { objectId: _this2.$route.query.id }
                }, param));

              case 2:
                items = _context2.sent;
                return _context2.abrupt('return', items);

              case 4:
              case 'end':
                return _context2.stop();
            }
          }
        }, _callee2, _this2);
      }))();
    },
    fetchPlans: function fetchPlans(param) {
      var _this3 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
        var p, _ref3, _ref4, entList, accidentTypeDic, emergencyObj, plans;

        return regenerator_default.a.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                p = [commonApi["a" /* commonApi */].search('ent_enterprise'), commonApi["a" /* commonApi */].dictionary('Accident_type'), commonApi["a" /* commonApi */].searchById('yj_emergency_information', _this3.$route.query.id), // 当前事故详情
                commonApi["a" /* commonApi */].search('yj_special_plan') // 查询所有预案
                ];
                _context3.next = 3;
                return promise_default.a.all(p);

              case 3:
                _ref3 = _context3.sent;
                _ref4 = slicedToArray_default()(_ref3, 4);
                entList = _ref4[0];
                accidentTypeDic = _ref4[1];
                emergencyObj = _ref4[2];
                plans = _ref4[3];

                _this3.emergencyObj = emergencyObj;
                // 增加状态字段
                plans.map(function (v) {
                  if (v.id === emergencyObj.reservePlan) {
                    v._state = 1;
                  } else {
                    v._state = 0;
                  }
                });
                return _context3.abrupt('return', Object(utils["d" /* ReplaceDictionary */])(plans, {
                  'enterprise_name:EnterpriseName:id': entList,
                  apply_type: accidentTypeDic
                }));

              case 12:
              case 'end':
                return _context3.stop();
            }
          }
        }, _callee3, _this3);
      }))();
    },
    onClickCase: function onClickCase(item) {
      this.$router.$push({
        path: '/emergency/info/accidentProfile',
        query: {
          id: item.id
        }
      });
    },
    use: function use(item, loaded) {
      var _this4 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
        return regenerator_default.a.wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context4.prev = _context4.next) {
              case 0:
                commonApi["a" /* commonApi */].save('yj_emergency_information', {
                  id: _this4.id,
                  OrganizationTime: Object(common_plugin["e" /* formatTime */])(item.createdAt),
                  reservePlan: item.id,
                  programme_name: item.title,
                  programme_type: item.apply_type
                }).then(function () {
                  _this4.$refs.group.startPull();
                  _this4.$Toast('应用成功!', 'success');
                }).catch(function (e) {
                  _this4.$Toast('应用失败!', 'error');
                }).then(loaded);

              case 1:
              case 'end':
                return _context4.stop();
            }
          }
        }, _callee4, _this4);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-4fbd1f4a","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/emergency/preliminary.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"初步研判","scroll":""}},[_c('yt-tabs',{attrs:{"slider":false},model:{value:(_vm.page),callback:function ($$v) {_vm.page=$$v},expression:"page"}},[_c('yt-tab-panel',{attrs:{"text":_vm.TABS.info}},[_c('yt-form',[_c('detail',{attrs:{"id":_vm.id}})],1)],1),_vm._v(" "),_c('yt-tab-panel',{attrs:{"text":_vm.TABS.cases}},[_c('yt-group',{ref:"group",attrs:{"group":false,"name":_vm.TABS.cases,"searchApi":_vm.searchApi},scopedSlots:_vm._u([{key:"default",fn:function(item){return _c('yt-card',{staticClass:"no-padding",attrs:{"tag":false,"title":item.programme_name,"btn":"查看详情"},on:{"btn-click":function($event){return _vm.onClickCase(item)}}},[_c('yt-cell',{attrs:{"label":"事故地点","border":"none","value":item.accident_place}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"事故时间","border":"none","value":_vm._f("formatTime")(item.createdAt)}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"报告人姓名","border":"none","value":item.name}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"报告人电话","border":"none"}},[_c('yt-cell-call',{attrs:{"tel":item.telephone || ''}})],1)],1)}}])})],1),_vm._v(" "),_c('yt-tab-panel',{attrs:{"text":_vm.TABS.plans}},[_c('yt-group',{attrs:{"group":false,"name":_vm.TABS.plans,"searchApi":_vm.searchApi},scopedSlots:_vm._u([{key:"default",fn:function(item){return _c('yt-card',{staticClass:"no-padding",attrs:{"tag":false,"title":item.title}},[_c('div',{attrs:{"slot":"more"},slot:"more"},[(item._state === 1)?_c('span',{staticClass:"c-green"},[_vm._v("已启用")]):_vm._e(),_vm._v(" "),(item._state === 0)?_c('yt-btn',{attrs:{"size":"mini","loading":function (loaded) { return _vm.use(item, loaded); }}},[_vm._v("启用")]):_vm._e()],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"适用事故类型","labelWidth":"120px","border":"none","value":item.apply_type}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"适用范围","border":"none","value":item.apply_range}})],1)}}])})],1)],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var emergency_preliminary = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/emergency/preliminary.vue
function injectStyle (ssrContext) {
  __webpack_require__("HCRc")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-4fbd1f4a"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  preliminary,
  emergency_preliminary,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var anjian_emergency_preliminary = __webpack_exports__["default"] = (Component.exports);


/***/ })

});